Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added querySystemLimits for CSI spec 1.6 #86

Merged
merged 18 commits into from
Oct 17, 2023
Merged

Added querySystemLimits for CSI spec 1.6 #86

merged 18 commits into from
Oct 17, 2023

Conversation

KshitijaKakde
Copy link
Contributor

@KshitijaKakde KshitijaKakde commented Oct 17, 2023

Description

Added querySystemLimits for CSI spec 1.6

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#905

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Tested the changes using integartion test and unit test

image

{"maxVal":"512","description":"Total Number of concurrent Move Pairs operations","type":"concurrentMovePairsOperations"},{"maxVal":"65536","minVal":"8","description":"Single replication volume size in GB","type":"replicationVolumeSizeGb"},{"maxVal":"262143","description":"Number of mappings between volumes and hosts","type":"replicationPairsPerReplicationConsistencyGroup"},{"maxVal":"512","description":"Number of host connections (IO controllers) per SDT","type":"ioControllersPerSdt"},{"maxVal":"128","description":"Depth of IO controller queue","type":"ioControllersQueueDepth"},{"maxVal":"32","description":"Number of IO controller queues","type":"ioControllersNumQueues"},{"maxVal":"8","description":"Number of paths per volume","type":"pathsPerVolume"},{"maxVal":"16","description":"Number of connections per host per protection domain","type":"connectionsPerHostPerProtectionDomain"},{"maxVal":"65519","description":"Number of host connections (IO controllers) per SYSTEM","type":"ioControllersPerSystem"}]}
0
1048576
max volume size in volumeSizeGb 1048576

@KshitijaKakde KshitijaKakde marked this pull request as ready for review October 17, 2023 03:59
@KshitijaKakde KshitijaKakde changed the title Added querySystemLimits forCSI spec 1.6 Added querySystemLimits for CSI spec 1.6 Oct 17, 2023
Copy link
Contributor

@VamsiSiddu-7 VamsiSiddu-7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable names in go follow some specific naming conventions example systemLimit etc.

system_limit.go Show resolved Hide resolved
system_limit.go Outdated

func (c *Client) GetSystemLimits() (syslimit *types.Limit, err error) {
defer TimeSpent("GetSystemLimits", time.Now())
var e emptyBody
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here instead of e give some meaningful variable name

system_limit.go Outdated
return nil, err
}

return syslimit, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

systemLimits

system_limit.go Outdated
// GetMaxVol returns max volume size in GB
func (c *Client) GetMaxVol() (sys string, err error) {
defer TimeSpent("GetMaxVol", time.Now())
maxlimitType, err := c.GetSystemLimits()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

systemLimits

}

// SystemLimitEntryList defines struct for system limit entryList
type Limit struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be good to rename it to QuerySystemLimitsResponse

@@ -1738,3 +1738,15 @@ type MDMQueueCommandDetails struct {
TargetEntityIdentifier string `json:"targetEntityIdentifier,omitempty"`
AllowedPhase string `json:"allowedPhase,omitempty"`
}

// QuerySystemLimits defines struct for query system limits
type QuerySystemLimits struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename it to SystemLimit

system_limit.go Outdated
types "github.com/dell/goscaleio/types/v1"
)

type QuerySystemLimitsParam struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to types/v1 types.go because all the types are defined there only

system_limit.go Outdated
// GetMaxVol returns max volume size in GB
func (c *Client) GetMaxVol() (systemLimits string, err error) {
defer TimeSpent("GetMaxVol", time.Now())
maxLimitType, err := c.GetSystemLimits()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the variable name to systemLimits

system_limit.go Outdated
return "", err
}

for _, systemType := range maxLimitType.SystemLimitEntryList {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

systemLimit

system_limit.go Outdated

for _, systemType := range maxLimitType.SystemLimitEntryList {

if systemType.Type == "volumeSizeGb" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

systemLimit.Type

system_limit.go Outdated
}

// GetMaxVol returns max volume size in GB
func (c *Client) GetMaxVol() (systemLimits string, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should return MaxVolumeSize not systemLimits change it.

@VamsiSiddu-7
Copy link
Contributor

please re run the integration and unit tests to make sure nothing is breaking

@KshitijaKakde KshitijaKakde merged commit 11580d2 into main Oct 17, 2023
1 check failed
@shanmydell shanmydell deleted the csi-changes branch October 16, 2024 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants